package Homework2;

class Rect{
    double _width;
    double _height;

    Rect()
    {
        this._height = 10;
        this._width = 10;
    }

    Rect(double width, double height)
    {
        this._height = height;
        this._width = width;
    }

    double area()
    {
        return this._width * this._height;
    }

    double perimeter()
    {
        return 2 * (this._height + this._width);
    }
}

class PlainRect extends Rect{
    double startX;
    double startY;

    PlainRect()
    {
        this.startX = 0;
        this.startY = 0;
        this._height = 10;
        this._width = 10;
    }

    PlainRect(double x, double y, double height, double width)
    {
        this._height = height;
        this._width = width;
        this.startX = x;
        this.startY = y;
    }

    boolean isInside(double x, double y)
    {
        return x >= startX && x <= (this.startX + this._width) && y < this.startY && y >=
        (this.startY-this._height) ;
    }
}

public class Demo2 {
    public static void main(String[] args) {
        PlainRect pr = new PlainRect(10, 10, 20, 10);
    
        System.out.println("Area: " + pr.area());
        System.out.println("Perimeter: " + pr.perimeter());

        if (pr.isInside(25.5, 13)) 
        {
            System.out.println("The point is inside the rectangle.");
        } 
        else 
        {
            System.out.println("The point is not inside the rectangle.");
        }
    }
    
}
